﻿@{
    //success messages
    var successMessages = new List<string>();
    if (TempData[string.Format("nop.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(TempData[string.Format("nop.notifications.{0}", NotifyType.Success)] as IList<string>);
    }
    if (ViewData[string.Format("nop.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(ViewData[string.Format("nop.notifications.{0}", NotifyType.Success)] as IList<string>);
    }


    //error messages
    var errorMessages = new List<string>();
    if (TempData[string.Format("nop.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(TempData[string.Format("nop.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
    if (ViewData[string.Format("nop.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(ViewData[string.Format("nop.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
}
@foreach (var message in successMessages)
{
    <script type="text/javascript">
        $(document).ready(function () {
            displayPopupNotification('@Html.Raw(HttpUtility.JavaScriptStringEncode(message))', 'success', false);
        });
    </script>
}
@foreach (var message in errorMessages)
{
    <script type="text/javascript">
        $(document).ready(function () {
            displayPopupNotification('@Html.Raw(HttpUtility.JavaScriptStringEncode(message))', 'error', false);
        });
    </script>
}

        <div class="notifications" id="dialog-notifications-success" title="@T("Common.Notification")" style="display:none;">
        </div>
        <div class="notifications" id="dialog-notifications-error" title="@T("Common.Error")" style="display:none;">
        </div>
        <div id="bar-notification" class="notifications" style="display: none;">
            <span class="close" title="@T("Common.Close")">&nbsp;</span>
            

        </div>
        @*<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>*@
    


@Html.Widget("notifications")
